package com.ice.work.moment.facade.crawler.enums;

/**
 * @Description A股列表爬取字段
 * @Author DELL
 * @Create 2019-01-09
 * @Since 1.0.0
 */
@SuppressWarnings("all")
public enum ShareEnum {

    STOCK_CODE(0, "code", "股票代码"),
    STOCK_NAME(1, "name", "股票名称"),
    TOTAL_CAPITAL_STOCK(12, "totalCapitalStock", "总股本"),
    TRADABLE_CAPITAL_STOCK(13, "tradableCapitalStock", "流通股本");

    public Integer key;
    public String code;
    public String remark;

    ShareEnum(Integer key, String code, String remark) {
        this.key = key;
        this.code = code;
        this.remark = remark;
    }

    public static String getCodeByKey(Integer key) {
        for (ShareEnum gender : ShareEnum.values()) {
            if (gender.key.equals(key)) {
                return gender.code;
            }
        }
        return null;
    }
}
